/*
 * Powered By dico
 * Since 2017 - 2018
 */package com.seeyoui.kensite.bussiness.orderlang.pay.service;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.seeyoui.kensite.common.base.service.BaseService;

import java.util.*;

import com.seeyoui.kensite.common.base.domain.EasyUIDataGrid;
import com.seeyoui.kensite.common.base.service.BaseService;
import com.seeyoui.kensite.common.exception.CRUDException;
import com.seeyoui.kensite.common.util.*;
import com.seeyoui.kensite.common.constants.StringConstant;
import com.seeyoui.kensite.bussiness.orderlang.pay.domain.AccountsReceivablePay;
import com.seeyoui.kensite.bussiness.orderlang.pay.domain.Pay;
import com.seeyoui.kensite.bussiness.orderlang.pay.domain.TransactionDetailsPay;
import com.seeyoui.kensite.bussiness.orderlang.pay.persistence.PayMapper;

/**
 * Pay
 * @author dico
 * @version 2.0
 * @since 1.0
 * @date 2018-02-07
 */

@Service
public class PayService extends BaseService {
	
	@Autowired
	private PayMapper payMapper;

	/**
	 * 根据ID查询单条数据
	 * @param id
	 * @return
	 * @throws CRUDException
	 */
	public Pay findOne(String id) throws CRUDException{
		return payMapper.findOne(id);
	}
	
	/**
	 * 查询数据集合
	 * @param pay
	 * @return
	 * @throws CRUDException
	 */
	public List<Pay> findList(Pay pay) throws CRUDException {
		return payMapper.findList(pay);
	}
	
	/**
     * 查询应收账款数据集合
     * @param map
     * @return
     * @throws CRUDException
     */
    public List<AccountsReceivablePay> findListAccountsReceivable(Map map) throws CRUDException {
        return payMapper.findListAccountsReceivable(map);
    }
    
    /**
     * 查询应收账款数据金额
     * @param map
     * @return
     * @throws CRUDException
     */
    public AccountsReceivablePay findListAccountsReceivableForSum(Map map) throws CRUDException {
        return payMapper.findListAccountsReceivableForSum(map);
    }
    
    /**
     * 查询收支明细数据金额
     * @param map
     * @return
     * @throws CRUDException
     */
    public List<TransactionDetailsPay> findListTransactionDetails(Map map) throws CRUDException {
        return payMapper.findListTransactionDetails(map);
    }
	
	/**
	 * 查询所有数据集合
	 * @param pay
	 * @return
	 * @throws CRUDException
	 */
	public List<Pay> findAll(Pay pay) throws CRUDException {
		return payMapper.findAll(pay);
	}
	
	/**
	 * 查询数据总数
	 * @param pay
	 * @return
	 * @throws CRUDException
	 */
	public int findTotal(Pay pay) throws CRUDException {
		return payMapper.findTotal(pay);
	}
	
	/**
     * 查询应收账款数据总数
     * @param map
     * @return
     * @throws CRUDException findTotalTransactionDetails
     */
    public int findTotalAccountsReceivable(Map map) throws CRUDException {
        return payMapper.findTotalAccountsReceivable(map);
    }
    
    /**
     * 查询收支明细数据总数
     * @param map
     * @return
     * @throws CRUDException 
     */
    public int findTotalTransactionDetails(Map map) throws CRUDException {
        return payMapper.findTotalTransactionDetails(map);
    }
	
	/**
	 * 查询数据总数排除当前数据
	 * @param pay
	 * @return
	 * @throws CRUDException
	 */
	public int findExTotal(Pay pay) throws CRUDException {
		return payMapper.findExTotal(pay);
	}
	
	/**
	 * 数据新增
	 * @param pay
	 * @throws CRUDException
	 */
	public void save(Pay pay) throws CRUDException{
		pay.preInsert();
		payMapper.save(pay);
	}
	
	/**
	 * 数据修改
	 * @param pay
	 * @throws CRUDException
	 */
	public void update(Pay pay) throws CRUDException{
		pay.preUpdate();
		payMapper.update(pay);			
	}
	
	/**
	 * 数据删除
	 * @param listId
	 * @throws CRUDException
	 */
	public void delete(List<String> listId) throws CRUDException {
		payMapper.delete(listId);
	}
	
	/**
	 * 数据假删除
	 * @param pay
	 * @throws CRUDException
	 */
	public void remove(Pay pay) throws CRUDException{
		pay.preUpdate();
		payMapper.remove(pay);			
	}
	
}